import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

import org.korifey.ffalg.NumberTheory;
import org.korifey.ffalg.Probabilities;


public class Problem19 {
	//1 Jan 1900 is Monday
	//1 Jan 1 AD is Monday
	public final static int[] monthDays = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	
	public static void main(String[] args) {
		System.out.println(solve());
	}	
	
	public static int daysInYear(int year) {
		return isLeap(year) ? 366: 365; 
	}
	
	public static boolean isLeap(int year) {
		return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0; 
	}
	
	//month starting with 0
	public static int nDays(int month, int year) {
		if (month == 1 && isLeap(year)) return 29;
		else return monthDays[month];
	}
	
	//0 - Monday, 6 - Sunday
	//days and month started from 0
	public static int countDayOfWeek(int dayOfMonth, int month, int year) {
		assert(month >= 0);
		assert(month < 12);
		assert(year >=1);
		
		int acc = 0;
		for (int y=1; y<year; y++) {
			acc += daysInYear(y);  
		}
		for (int m=0; m<month; m++) {
			acc += nDays(m, year);
		}
		acc+=dayOfMonth;
		return acc%7;
	}
	
	public static long solve() {
		//int startDay = countDayOfWeek(0, 0, 1901);
		int acc = 0;
		for (int year = 1901; year <= 2000; year++) {
			for (int month = 0; month < 12; month ++) {
				if (countDayOfWeek(0, month, year) == 6) {
					acc++;
				}
			}
		}
		return acc;
	}
	
}
